package com.jic.member.service;

import java.util.Map;

/**
 * @Author zzy
 * @Description //微信jsApi
 * @Date 上午10:51 2020/6/17
 * @Param
 * @return
 **/
public interface JsApiService {

    /**
     * 根据mediaId获取base64图片
     * @param mediaId 微信上的多媒体唯一编号
     * @return 返回base64图片字符串
     */
    public String downloadMedia(String mediaId) throws Exception;


    public void init(String appid , String secret);

    /**
     * 获取微信网页授权token
     * @param code
     * @return
     * @throws Exception
     */
    public Map<String, Object> getWeixinToken(String code) throws Exception;


    public Map<String, Object> getMiniProgramToken(String code) throws Exception;


    /**
     * 根据open获取微信token，注意此方法掉之前必须先掉getWeixinToken，并且此方法只能调用一次
     * @param openId
     * @return
     * @throws Exception
     */
    public Map<String, Object> getWeixinTokenByOpenId(String openId) throws Exception;


    /**
     * 获取调用weixin api的token
     * @return
     * @throws Exception
     */
    public String getWeiXinApiToken() throws Exception;


    /**
     * 获取调用weixin api的签名
     * @param url 当前网页的url
     * @return
     * @throws Exception
     */
    public Map<String,String> getWeiXinApiSign(String url) throws Exception;


    /**
     * 通过授权token获取微信用户信息
     * @param access_token
     * @param openId
     * @return
     * @throws Exception
     */
    public Map<String,Object>  getWeixinUserInfo(String access_token , String openId) throws Exception;


    /**
     * 获取二维码
     * @param phone
     * @return
     * @throws Exception
     */
    public String getQrcode(String phone) throws Exception;
}
